package sudroid;

import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.FileFilter;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.RandomAccessFile;
import java.io.UnsupportedEncodingException;
import java.net.URL;
import java.security.CodeSource;
import java.security.ProtectionDomain;

public class FileUtil
{
  private static final int DEFAULT_DELETE_LINITE = 5;
  private static FileFilter dirOnlyFilter;
  private static FileFilter fileOnlyFilter;

  private static boolean __createNewFile(File paramFile)
  {
    AssertUtil.checkNull(paramFile);
    makesureParentExist(paramFile);
    if (paramFile.exists())
      delete(paramFile);
    try
    {
      boolean bool1 = paramFile.createNewFile();
      bool2 = bool1;
      return bool2;
    }
    catch (IOException localIOException)
    {
      while (true)
      {
        LogUtils.e(localIOException);
        boolean bool2 = false;
      }
    }
  }

  public static void copy(File paramFile1, File paramFile2)
    throws IOException
  {
    AssertUtil.checkNull(paramFile1);
    AssertUtil.checkNull(paramFile2);
    makesureParentExist(paramFile2);
    FileInputStream localFileInputStream = new FileInputStream(paramFile1);
    FileOutputStream localFileOutputStream = new FileOutputStream(paramFile2);
    copy(localFileInputStream, localFileOutputStream);
  }

  public static void copy(InputStream paramInputStream, OutputStream paramOutputStream)
    throws IOException
  {
    AssertUtil.checkNull(paramInputStream);
    AssertUtil.checkNull(paramOutputStream);
    int i = 524288;
    try
    {
      byte[] arrayOfByte = new byte[524288];
      paramInputStream = makeInputBuffered(paramInputStream);
      paramOutputStream = makeOutputBuffered(paramOutputStream);
      while (true)
      {
        int j = paramInputStream.read(arrayOfByte);
        int k = j;
        if (k == -1)
        {
          boolean bool1;
          boolean bool2;
          return;
        }
        i = 0;
        paramOutputStream.write(arrayOfByte, i, k);
        paramOutputStream.flush();
      }
    }
    catch (IOException localIOException)
    {
      throw localIOException;
    }
    finally
    {
      boolean bool3 = CleanUtils.closeStream(paramInputStream);
      boolean bool4 = CleanUtils.closeStream(paramOutputStream);
    }
    throw localObject;
  }

  public static void copy(String paramString1, String paramString2)
    throws IOException
  {
    AssertUtil.checkStringNullOrEmpty(paramString1);
    AssertUtil.checkStringNullOrEmpty(paramString2);
    File localFile1 = new File(paramString1);
    File localFile2 = new File(paramString2);
    copy(localFile1, localFile2);
  }

  public static void copyWithoutOutputClosing(InputStream paramInputStream, OutputStream paramOutputStream)
    throws IOException
  {
    AssertUtil.checkNull(paramInputStream);
    AssertUtil.checkNull(paramOutputStream);
    int i = 524288;
    try
    {
      byte[] arrayOfByte = new byte[524288];
      paramInputStream = makeInputBuffered(paramInputStream);
      paramOutputStream = makeOutputBuffered(paramOutputStream);
      while (true)
      {
        int j = paramInputStream.read(arrayOfByte);
        if (j == -1)
        {
          paramOutputStream.flush();
          boolean bool1;
          return;
        }
        i = 0;
        paramOutputStream.write(arrayOfByte, i, j);
        paramOutputStream.flush();
      }
    }
    catch (IOException localIOException)
    {
      throw localIOException;
    }
    finally
    {
      boolean bool2 = CleanUtils.closeStream(paramInputStream);
    }
    throw localObject;
  }

  public static void createNewFile(File paramFile)
  {
    AssertUtil.checkNull(paramFile);
    if ((!__createNewFile(paramFile)) && (LogUtils.isDebug()))
    {
      String str1 = String.valueOf(paramFile.getAbsolutePath());
      String str2 = str1 + " doesn't be created!";
      throw new RuntimeException(str2);
    }
  }

  public static void delete(File paramFile)
  {
    if ((paramFile != null) && (paramFile.exists()) && (!paramFile.delete()) && (LogUtils.isDebug()))
    {
      String str1 = String.valueOf(paramFile.getAbsolutePath());
      String str2 = str1 + " doesn't be deleted!";
      throw new RuntimeException(str2);
    }
  }

  public static boolean deleteDependon(File paramFile)
  {
    return deleteDependon(paramFile, 0);
  }

  public static boolean deleteDependon(File paramFile, int paramInt)
  {
    int i = 1;
    if (paramInt < 1)
      paramInt = 5;
    boolean bool = false;
    if (paramFile != null);
    while (true)
    {
      if ((bool) || (i > paramInt) || (!paramFile.isFile()) || (!paramFile.exists()))
        return bool;
      bool = paramFile.delete();
      if (bool)
        continue;
      String str = String.valueOf(paramFile.getAbsolutePath());
      LogUtils.i(str + "删除失败，失败次数为:" + i);
      i += 1;
    }
  }

  public static boolean deleteDependon(String paramString)
  {
    return deleteDependon(paramString, 0);
  }

  public static boolean deleteDependon(String paramString, int paramInt)
  {
    if (TextUtils.isEmpty(paramString));
    boolean bool;
    for (int i = 0; ; bool = deleteDependon(new File(paramString), paramInt))
      return i;
  }

  public static void deleteFiles(File paramFile)
  {
    AssertUtil.checkNull(paramFile);
    File[] arrayOfFile;
    int j;
    if ((paramFile.exists()) && (paramFile.isDirectory()))
    {
      arrayOfFile = paramFile.listFiles();
      int i = arrayOfFile.length;
      j = 0;
      if (j >= i)
        delete(paramFile);
    }
    while (true)
    {
      return;
      File localFile = arrayOfFile[j];
      if (localFile.isFile())
        delete(localFile);
      while (true)
      {
        j += 1;
        break;
        if (!localFile.isDirectory())
          continue;
        deleteFiles(localFile);
      }
      if ((!paramFile.exists()) || (!paramFile.isFile()))
        continue;
      delete(paramFile);
    }
  }

  public static void deleteFiles(String paramString)
  {
    AssertUtil.checkStringNullOrEmpty(paramString);
    deleteFiles(new File(paramString));
  }

  public static boolean doesExisted(File paramFile)
  {
    if ((paramFile != null) && (paramFile.exists()));
    for (int i = 1; ; i = 0)
      return i;
  }

  public static boolean doesExisted(String paramString)
  {
    if (TextUtils.isEmpty(paramString));
    boolean bool;
    for (int i = 0; ; bool = doesExisted(new File(paramString)))
      return i;
  }

  /** @deprecated */
  public static FileFilter getDirOnlyFilter()
  {
    monitorenter;
    try
    {
      if (dirOnlyFilter == null)
        dirOnlyFilter = new FileUtil.2();
      FileFilter localFileFilter = dirOnlyFilter;
      monitorexit;
      return localFileFilter;
    }
    finally
    {
      localObject = finally;
      monitorexit;
    }
    throw localObject;
  }

  public static FileOutputStream getEmptyFileOutputStream(File paramFile)
    throws FileNotFoundException
  {
    AssertUtil.checkNull(paramFile);
    if (!paramFile.exists())
      makesureParentExist(paramFile);
    while (true)
    {
      createNewFile(paramFile);
      return new FileOutputStream(paramFile);
      delete(paramFile);
    }
  }

  public static FileOutputStream getEmptyFileOutputStream(String paramString)
    throws FileNotFoundException
  {
    AssertUtil.checkStringNullOrEmpty(paramString);
    return getEmptyFileOutputStream(new File(paramString));
  }

  public static FileInputStream getFileInputStream(File paramFile)
  {
    Object localObject = null;
    try
    {
      FileInputStream localFileInputStream = new FileInputStream(paramFile);
      localObject = localFileInputStream;
      return localObject;
    }
    catch (FileNotFoundException localFileNotFoundException)
    {
      while (true)
        LogUtils.e(localFileNotFoundException);
    }
  }

  public static FileInputStream getFileInputStream(String paramString)
  {
    return getFileInputStream(new File(paramString));
  }

  /** @deprecated */
  public static FileFilter getFileOnlyFilter()
  {
    monitorenter;
    try
    {
      if (fileOnlyFilter == null)
        fileOnlyFilter = new FileUtil.1();
      FileFilter localFileFilter = fileOnlyFilter;
      monitorexit;
      return localFileFilter;
    }
    finally
    {
      localObject = finally;
      monitorexit;
    }
    throw localObject;
  }

  public static FileOutputStream getFileOutputStream(File paramFile)
  {
    Object localObject = null;
    try
    {
      FileOutputStream localFileOutputStream = new FileOutputStream(paramFile);
      localObject = localFileOutputStream;
      return localObject;
    }
    catch (FileNotFoundException localFileNotFoundException)
    {
      while (true)
        LogUtils.e(localFileNotFoundException);
    }
  }

  public static FileOutputStream getFileOutputStream(String paramString)
  {
    return getFileOutputStream(new File(paramString));
  }

  public static long getFileSize(File paramFile)
  {
    AssertUtil.checkNull(paramFile);
    int i = 0;
    if (!paramFile.exists())
    {
      String str = String.valueOf(paramFile.getAbsolutePath());
      LogUtils.d(str + " dones't exist.");
    }
    while (true)
    {
      return i;
      if (paramFile.isFile())
      {
        long l1 = 0;
        long l2 = paramFile.length();
        i = (int)(l1 + l2);
        continue;
      }
      File[] arrayOfFile = paramFile.listFiles();
      int j = arrayOfFile.length;
      int k = 0;
      while (k < j)
      {
        File localFile = arrayOfFile[k];
        long l3 = i;
        long l4 = getFileSize(localFile);
        i = (int)(l3 + l4);
        k += 1;
      }
    }
  }

  public static long getFileSize(String paramString)
  {
    AssertUtil.checkStringNullOrEmpty(paramString);
    return getFileSize(new File(paramString));
  }

  public static String getJarPath(Class<?> paramClass)
  {
    try
    {
      String str1 = paramClass.getProtectionDomain().getCodeSource().getLocation().toString();
      if (str1.startsWith("file:/"))
      {
        int i = "file:/".length();
        String str2 = str1.substring(i);
        str3 = str2;
        return str3;
      }
    }
    catch (Exception localException)
    {
      while (true)
        String str3 = "";
    }
  }

  public static boolean isSame(File paramFile1, File paramFile2)
  {
    AssertUtil.checkNull(paramFile1);
    AssertUtil.checkNull(paramFile2);
    long l1 = paramFile1.length();
    long l2 = paramFile2.length();
    int i;
    if (l1 != l2)
      i = 0;
    while (true)
    {
      return i;
      try
      {
        FileInputStream localFileInputStream1 = new FileInputStream(paramFile1);
        FileInputStream localFileInputStream2 = new FileInputStream(paramFile2);
        boolean bool = isSame(localFileInputStream1, localFileInputStream2);
        i = bool;
      }
      catch (FileNotFoundException localFileNotFoundException)
      {
        LogUtils.e(localFileNotFoundException);
        i = 0;
      }
    }
  }

  public static boolean isSame(InputStream paramInputStream1, InputStream paramInputStream2)
  {
    AssertUtil.checkNull(paramInputStream1);
    AssertUtil.checkNull(paramInputStream2);
    paramInputStream1 = makeInputBuffered(paramInputStream1);
    paramInputStream2 = makeInputBuffered(paramInputStream2);
    try
    {
      int i = paramInputStream1.read();
      int j = paramInputStream2.read();
      int k = j;
      if (i != k)
      {
        boolean bool1 = CleanUtils.closeStream(paramInputStream1);
        boolean bool2 = CleanUtils.closeStream(paramInputStream2);
      }
      for (int m = 0; ; m = 1)
      {
        return m;
        if (i != -1)
          break;
        boolean bool3 = CleanUtils.closeStream(paramInputStream1);
        boolean bool4 = CleanUtils.closeStream(paramInputStream2);
      }
    }
    catch (Exception localException)
    {
      while (true)
      {
        LogUtils.e(localException);
        boolean bool5 = CleanUtils.closeStream(paramInputStream1);
        boolean bool6 = CleanUtils.closeStream(paramInputStream2);
      }
    }
    finally
    {
      boolean bool7 = CleanUtils.closeStream(paramInputStream1);
      boolean bool8 = CleanUtils.closeStream(paramInputStream2);
    }
    throw localObject;
  }

  public static boolean isSame(String paramString1, String paramString2)
  {
    AssertUtil.checkStringNullOrEmpty(paramString1);
    AssertUtil.checkStringNullOrEmpty(paramString2);
    File localFile1 = new File(paramString1);
    File localFile2 = new File(paramString2);
    return isSame(localFile1, localFile2);
  }

  // ERROR //
  public static Object loadObject(InputStream paramInputStream)
    throws IOException, ClassNotFoundException
  {
    // Byte code:
    //   0: aload_0
    //   1: invokestatic 25	sudroid/AssertUtil:checkNull	(Ljava/lang/Object;)V
    //   4: aconst_null
    //   5: astore_1
    //   6: aload_0
    //   7: invokestatic 64	sudroid/FileUtil:makeInputBuffered	(Ljava/io/InputStream;)Ljava/io/InputStream;
    //   10: astore_2
    //   11: new 272	java/io/ObjectInputStream
    //   14: dup
    //   15: aload_2
    //   16: invokespecial 275	java/io/ObjectInputStream:<init>	(Ljava/io/InputStream;)V
    //   19: astore_3
    //   20: aload_3
    //   21: invokevirtual 279	java/io/ObjectInputStream:readObject	()Ljava/lang/Object;
    //   24: astore 4
    //   26: aload 4
    //   28: astore 5
    //   30: aload_3
    //   31: invokestatic 80	sudroid/CleanUtils:closeStream	(Ljava/io/Closeable;)Z
    //   34: istore 6
    //   36: aload 5
    //   38: areturn
    //   39: astore 7
    //   41: aload 7
    //   43: athrow
    //   44: astore 8
    //   46: aload_1
    //   47: invokestatic 80	sudroid/CleanUtils:closeStream	(Ljava/io/Closeable;)Z
    //   50: istore 9
    //   52: aload 8
    //   54: athrow
    //   55: astore 7
    //   57: aload 7
    //   59: athrow
    //   60: astore 8
    //   62: aload_3
    //   63: astore_1
    //   64: goto -18 -> 46
    //   67: astore 7
    //   69: aload_3
    //   70: astore_1
    //   71: goto -14 -> 57
    //   74: astore 7
    //   76: aload_3
    //   77: astore_1
    //   78: goto -37 -> 41
    //
    // Exception table:
    //   from	to	target	type
    //   6	20	39	java/io/IOException
    //   6	20	44	finally
    //   41	44	44	finally
    //   57	60	44	finally
    //   6	20	55	java/lang/ClassNotFoundException
    //   20	26	60	finally
    //   20	26	67	java/lang/ClassNotFoundException
    //   20	26	74	java/io/IOException
  }

  public static Object loadObject(String paramString)
    throws IOException, ClassNotFoundException
  {
    AssertUtil.checkStringNullOrEmpty(paramString);
    if (doesExisted(new File(paramString)));
    for (Object localObject = loadObject(new FileInputStream(paramString)); ; localObject = null)
      return localObject;
  }

  public static InputStream makeInputBuffered(InputStream paramInputStream)
  {
    AssertUtil.checkNull(paramInputStream);
    if ((paramInputStream instanceof BufferedInputStream));
    for (Object localObject = paramInputStream; ; localObject = new BufferedInputStream(paramInputStream, 524288))
      return localObject;
  }

  public static OutputStream makeOutputBuffered(OutputStream paramOutputStream)
  {
    AssertUtil.checkNull(paramOutputStream);
    if ((paramOutputStream instanceof BufferedOutputStream));
    for (Object localObject = paramOutputStream; ; localObject = new BufferedOutputStream(paramOutputStream, 524288))
      return localObject;
  }

  public static void makesureFileExist(File paramFile)
  {
    AssertUtil.checkNull(paramFile);
    if (!paramFile.exists())
    {
      makesureParentExist(paramFile);
      createNewFile(paramFile);
    }
  }

  public static void makesureFileExist(String paramString)
  {
    AssertUtil.checkStringNullOrEmpty(paramString);
    makesureFileExist(new File(paramString));
  }

  public static void makesureParentExist(File paramFile)
  {
    AssertUtil.checkNull(paramFile);
    File localFile = paramFile.getParentFile();
    if ((localFile != null) && (!localFile.exists()))
      mkdirs(localFile);
  }

  public static void makesureParentExist(String paramString)
  {
    AssertUtil.checkStringNullOrEmpty(paramString);
    makesureParentExist(new File(paramString));
  }

  public static void mkdirs(File paramFile)
  {
    AssertUtil.checkNull(paramFile);
    if ((!paramFile.exists()) && (!paramFile.mkdirs()) && (LogUtils.isDebug()))
    {
      StringBuilder localStringBuilder = new StringBuilder("fail to make ");
      String str1 = paramFile.getAbsolutePath();
      String str2 = str1;
      throw new RuntimeException(str2);
    }
  }

  public static byte[] readFile(File paramFile)
  {
    AssertUtil.checkNull(paramFile);
    return readInputStream(getFileInputStream(paramFile));
  }

  public static byte[] readFile(String paramString)
    throws FileNotFoundException
  {
    AssertUtil.checkStringNullOrEmpty(paramString);
    File localFile = new File(paramString);
    if ((doesExisted(localFile)) && (localFile.isFile()))
      return readFile(localFile);
    String str = localFile.getAbsolutePath();
    throw new FileNotFoundException(str);
  }

  public static String readFileForString(File paramFile)
  {
    byte[] arrayOfByte = readFile(paramFile);
    return new String(arrayOfByte);
  }

  public static String readFileForString(File paramFile, String paramString)
    throws UnsupportedEncodingException
  {
    AssertUtil.checkStringNullOrEmpty(paramString);
    byte[] arrayOfByte = readFile(paramFile);
    return new String(arrayOfByte, paramString);
  }

  public static String readFileForString(String paramString)
    throws FileNotFoundException
  {
    byte[] arrayOfByte = readFile(paramString);
    return new String(arrayOfByte);
  }

  public static String readFileForString(String paramString1, String paramString2)
    throws UnsupportedEncodingException, FileNotFoundException
  {
    AssertUtil.checkStringNullOrEmpty(paramString2);
    byte[] arrayOfByte = readFile(paramString1);
    return new String(arrayOfByte, paramString2);
  }

  // ERROR //
  public static byte[] readInputStream(InputStream paramInputStream)
  {
    // Byte code:
    //   0: aload_0
    //   1: invokestatic 25	sudroid/AssertUtil:checkNull	(Ljava/lang/Object;)V
    //   4: aload_0
    //   5: ifnull +54 -> 59
    //   8: aconst_null
    //   9: astore_1
    //   10: new 334	java/io/ByteArrayOutputStream
    //   13: dup
    //   14: ldc 60
    //   16: invokespecial 337	java/io/ByteArrayOutputStream:<init>	(I)V
    //   19: astore_2
    //   20: aload_0
    //   21: aload_2
    //   22: invokestatic 339	sudroid/FileUtil:copyWithoutOutputClosing	(Ljava/io/InputStream;Ljava/io/OutputStream;)V
    //   25: aload_2
    //   26: invokevirtual 343	java/io/ByteArrayOutputStream:toByteArray	()[B
    //   29: astore_3
    //   30: aload_3
    //   31: astore 4
    //   33: aload_2
    //   34: invokestatic 80	sudroid/CleanUtils:closeStream	(Ljava/io/Closeable;)Z
    //   37: istore 5
    //   39: aload 4
    //   41: astore 6
    //   43: aload 6
    //   45: areturn
    //   46: astore 7
    //   48: aload 7
    //   50: invokestatic 47	sudroid/LogUtils:e	(Ljava/lang/Throwable;)V
    //   53: aload_1
    //   54: invokestatic 80	sudroid/CleanUtils:closeStream	(Ljava/io/Closeable;)Z
    //   57: istore 8
    //   59: aconst_null
    //   60: astore 6
    //   62: goto -19 -> 43
    //   65: astore 6
    //   67: aload_1
    //   68: invokestatic 80	sudroid/CleanUtils:closeStream	(Ljava/io/Closeable;)Z
    //   71: istore 9
    //   73: aload 6
    //   75: athrow
    //   76: astore 6
    //   78: aload_2
    //   79: astore_1
    //   80: goto -13 -> 67
    //   83: astore 7
    //   85: aload_2
    //   86: astore_1
    //   87: goto -39 -> 48
    //
    // Exception table:
    //   from	to	target	type
    //   10	20	46	java/io/IOException
    //   10	20	65	finally
    //   48	53	65	finally
    //   20	30	76	finally
    //   20	30	83	java/io/IOException
  }

  public static void renameLowercase(File paramFile)
  {
    AssertUtil.checkNull(paramFile);
    if ((doesExisted(paramFile)) && (paramFile.isFile()))
    {
      String str1 = paramFile.getParent();
      if (str1 == null)
        str1 = "";
      String str2 = String.valueOf(str1);
      StringBuilder localStringBuilder = new StringBuilder(str2).append("/");
      String str3 = paramFile.getName().toLowerCase();
      String str4 = str3;
      String str5 = paramFile.getAbsolutePath();
      if (!str4.equals(str5))
      {
        File localFile = new File(str4);
        renameTo(paramFile, localFile);
      }
    }
  }

  public static void renameLowercase(String paramString)
  {
    renameLowercase(new File(paramString));
  }

  public static void renameTo(File paramFile1, File paramFile2)
  {
    if ((paramFile1 != null) && (paramFile2 != null) && (paramFile1.exists()) && (!paramFile1.renameTo(paramFile2)) && (LogUtils.isDebug()))
    {
      String str1 = String.valueOf(paramFile1.getAbsolutePath());
      StringBuilder localStringBuilder = new StringBuilder(str1).append(" doesn't be rename to ");
      String str2 = paramFile2.getAbsolutePath();
      String str3 = str2;
      throw new RuntimeException(str3);
    }
  }

  public static void renameUpperCase(File paramFile)
  {
    AssertUtil.checkNull(paramFile);
    if ((doesExisted(paramFile)) && (paramFile.isFile()))
    {
      String str1 = paramFile.getParent();
      if (str1 == null)
        str1 = "";
      String str2 = String.valueOf(str1);
      StringBuilder localStringBuilder = new StringBuilder(str2).append("/");
      String str3 = paramFile.getName().toUpperCase();
      String str4 = str3;
      String str5 = paramFile.getAbsolutePath();
      if (!str4.equals(str5))
      {
        File localFile = new File(str4);
        renameTo(paramFile, localFile);
      }
    }
  }

  public static void renameUpperCase(String paramString)
  {
    renameUpperCase(new File(paramString));
  }

  // ERROR //
  public static void saveObject(Object paramObject, OutputStream paramOutputStream)
    throws IOException
  {
    // Byte code:
    //   0: aload_0
    //   1: invokestatic 25	sudroid/AssertUtil:checkNull	(Ljava/lang/Object;)V
    //   4: aload_1
    //   5: invokestatic 25	sudroid/AssertUtil:checkNull	(Ljava/lang/Object;)V
    //   8: aconst_null
    //   9: astore_2
    //   10: aload_1
    //   11: invokestatic 68	sudroid/FileUtil:makeOutputBuffered	(Ljava/io/OutputStream;)Ljava/io/OutputStream;
    //   14: astore_3
    //   15: new 378	java/io/ObjectOutputStream
    //   18: dup
    //   19: aload_3
    //   20: invokespecial 381	java/io/ObjectOutputStream:<init>	(Ljava/io/OutputStream;)V
    //   23: astore 4
    //   25: aload 4
    //   27: aload_0
    //   28: invokevirtual 384	java/io/ObjectOutputStream:writeObject	(Ljava/lang/Object;)V
    //   31: aload 4
    //   33: invokestatic 80	sudroid/CleanUtils:closeStream	(Ljava/io/Closeable;)Z
    //   36: istore 5
    //   38: return
    //   39: astore 6
    //   41: aload 6
    //   43: athrow
    //   44: astore 7
    //   46: aload_2
    //   47: invokestatic 80	sudroid/CleanUtils:closeStream	(Ljava/io/Closeable;)Z
    //   50: istore 8
    //   52: aload 7
    //   54: athrow
    //   55: astore 7
    //   57: aload 4
    //   59: astore_2
    //   60: goto -14 -> 46
    //   63: astore 6
    //   65: aload 4
    //   67: astore_2
    //   68: goto -27 -> 41
    //
    // Exception table:
    //   from	to	target	type
    //   10	25	39	java/io/IOException
    //   10	25	44	finally
    //   41	44	44	finally
    //   25	31	55	finally
    //   25	31	63	java/io/IOException
  }

  public static void saveObject(Object paramObject, String paramString)
    throws IOException
  {
    AssertUtil.checkNull(paramObject);
    AssertUtil.checkStringNullOrEmpty(paramString);
    FileOutputStream localFileOutputStream = new FileOutputStream(paramString);
    saveObject(paramObject, localFileOutputStream);
  }

  public static void writeToRandomAccessFile(RandomAccessFile paramRandomAccessFile, InputStream paramInputStream)
  {
    AssertUtil.checkNull(paramRandomAccessFile);
    AssertUtil.checkNull(paramInputStream);
    int i = 524288;
    try
    {
      byte[] arrayOfByte = new byte[524288];
      paramInputStream = makeInputBuffered(paramInputStream);
      while (true)
      {
        int j = paramInputStream.read(arrayOfByte);
        int k = j;
        if (k == -1)
        {
          boolean bool1;
          return;
        }
        i = 0;
        paramRandomAccessFile.write(arrayOfByte, i, k);
      }
    }
    catch (IOException localIOException)
    {
      while (true)
      {
        LogUtils.e(localIOException);
        boolean bool2 = CleanUtils.closeStream(paramInputStream);
      }
    }
    finally
    {
      boolean bool3 = CleanUtils.closeStream(paramInputStream);
    }
    throw localObject;
  }

  public static void writeToRandomAccessFile(RandomAccessFile paramRandomAccessFile, byte[] paramArrayOfByte)
  {
    AssertUtil.checkNull(paramRandomAccessFile);
    AssertUtil.checkArrayNullOrEmpty(paramArrayOfByte);
    ByteArrayInputStream localByteArrayInputStream = new ByteArrayInputStream(paramArrayOfByte);
    writeToRandomAccessFile(paramRandomAccessFile, localByteArrayInputStream);
  }

  public static void writeUTF8ToRandomAccessFile(RandomAccessFile paramRandomAccessFile, String paramString)
  {
    AssertUtil.checkNull(paramRandomAccessFile);
    try
    {
      if (!TextUtils.isEmpty(paramString))
      {
        byte[] arrayOfByte = paramString.getBytes("UTF-8");
        writeToRandomAccessFile(paramRandomAccessFile, arrayOfByte);
      }
      return;
    }
    catch (UnsupportedEncodingException localUnsupportedEncodingException)
    {
      while (true)
        LogUtils.e(localUnsupportedEncodingException);
    }
  }
}

/* Location:           D:\Program Files\eclipse\apktool-r01-3\新浪微博\classes.dex.dex2jar.jar
 * Qualified Name:     sudroid.FileUtil
 * JD-Core Version:    0.6.0
 */